<%@ page import="java.util.ArrayList" %>
<%@ page import="net.amsoft.iservice.icontact.util.IContactConstants" %>
<%@ page import="net.amsoft.iservice.icontact.hibernate.IBroker" %>
<%@ page import="net.amsoft.iservice.icontact.service.IContact" %>
<%@ page import="java.util.Map" %>
<%@ page import="net.amsoft.iservice.icontact.hibernate.dataObject.LoginData" %>
<%@ include file="base.jsp" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
	// Service URLs
	String issoURL = "#";
	String forwardingURL = "#";
	
	// Get IBroker Data
	IBroker oIBroker = IContact.getIBroker(request.getServerName());

	// Get loggedInSynonym
	LoginData oLoginData = (LoginData) session.getAttribute(IContactConstants.SESSION_LOGIN_OBJ);
	if ((oIBroker!=null) && (oLoginData!=null))
	{
		issoURL = oIBroker.getIssoURL() + oLoginData.getLoggedInSynonym();
		forwardingURL = oIBroker.getForwardingURL() + oLoginData.getLoggedInSynonym();
	}

%>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title><bean:message key="title.home" /></title>
<link rel="stylesheet" type="text/css" href="styleSheets/iservices.css" />
<script src="js/help.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--

function submit(doAction)
{
	document.LoginForm.action=appBase+doAction;
	document.LoginForm.submit();
	
}
//-->
</SCRIPT>

</head>

<body>
<center>
<table cellspacing=25 border=0 cellpadding=0 width="800">
	<%@ include file="leftMenu.jsp" %>
	<td width=605 valign="top">
		<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td align="left" colspan="3" cellspacing="0" cellpadding="0" height="23px"><a href="<%=issoURL%>"><img 
src="<%=imagePath%>/tab-noclick-isso.jpg" border="0" onmouseover="this.src='<%=imagePath%>/tab-rollover-isso.jpg'" 
onmouseout="this.src='<%=imagePath%>/tab-noclick-isso.jpg'" /></a><img src="<%=imagePath%>/tab-click-contact.jpg" border="0" 
onmouseover="this.src='<%=imagePath%>/tab-rollover-contact.jpg'" onmouseout="this.src='<%=imagePath%>/tab-click-contact.jpg'" 
/><a href="<%=forwardingURL%>"><img src="<%=imagePath%>/tab-noclick-forwarding.jpg" border="0" 
onmouseover="this.src='<%=imagePath%>/tab-rollover-forwarding.jpg'" 
onmouseout="this.src='<%=imagePath%>/tab-noclick-forwarding.jpg'" /></a></td></tr>
			<tr>
				<td valign="top">
				<table border="0" cellspacing="0" cellpadding="0" width=270>
					<tr height="45">
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						<td width="270" bgcolor="#999999">
							<table bgcolor="#999999">
								<tr valign="top">
									<td><img src="<%=imagePath%>/title_contact_home.gif" align="left"/></td>
									<td>
										<html:link action="/Logout" titleKey="msg.logout"> 
											<img src="<%=imagePath%>/button-logout.jpg" border="0" align="right" />
										</html:link>
									</td>
								</tr>
							</table>
						</td>
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					</tr>						
					<tr>
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						<td width="270" bgcolor="#CCCCCC">
						<table border="0" cellspacing="0" cellpadding="0" width=290>
							<tr>
								<td >&nbsp;</td>			
								<td  colspan="2" height="35px"><font class="black-smalltext">
									&nbsp;&nbsp;<bean:message
									key="label.welcome" /><b> <bean:write name="LoginData"
									property="loggedInSynonym" scope="session" /></b></font>
								</td>
								<td >&nbsp;</td>				
							</tr>
							<tr>
								<td >&nbsp;</td>			
								<td colspan=2" class="blue-smalltext"><b><html:errors /></b></td>
								<td >&nbsp;</td>				
							</tr>
							<tr>
								<td >&nbsp;</td>						
								<td height="2px" colspan="2" valign="middle"><img
									src="<%=imagePath%>/dotted-line.gif" /></td>
									<td >&nbsp;</td>								
							</tr>
							<tr>
								<td >&nbsp;</td>			
								<td height="5px" colspan="2" class="blue-smalltext">
									<bean:message key="label.static.home" />
								</td>
								<td >&nbsp;</td>				
							</tr>
							<tr>
								<td >&nbsp;</td>
								<td>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								</td>
								<td colspan="1" align="right">
									&nbsp;&nbsp;
									<html:link action="/Requests" titleKey="msg.view.req"> 
										<img src="<%=imagePath%>/button-view-requests.jpg" border="0" align="right"/>
									</html:link>
								</td>
							</tr>
							<tr>
								<td >&nbsp;</td>			
								<td height="8px" colspan="2">&nbsp;</td>
								<td >&nbsp;</td>				
							</tr>
							<tr>
								<td >&nbsp;</td>						
								<td height="2px" colspan="3" valign="middle"><img
									src="<%=imagePath%>/dotted-line.gif" /></td>
							</tr>
							<tr>
								<td colspan="4" >&nbsp;</td>
							</tr>
							<tr>
								<td >&nbsp;</td>			
									<td colspan="2" class="black-smalltext" >  <bean:message key="label.select.configure" />
									<font class="blue-smalltext"><bean:message key="label.synonym" /> </font>
									<a href="#" class="link-nounderline blue-xsmalltext" onmouseover="showHelp('<bean:message key='label.help.synonymtitle'/>','<bean:message	key='label.help.synonymmsg' />');"> <img border="0" src="<%=imagePath%>/help-bullet.jpg"/></a> 
									<bean:message key="label.select.configure2" />
									</td>
								<td >&nbsp;</td>				
							</tr>
							<tr>
								<td colspan="4" >&nbsp;</td>
							</tr>
							<tr valign="middle">
								<td >&nbsp;</td>						
								<html:form action="/PreConfig" method="POST">
								<td colspan="2" height="45px" class="black-smalltext" valign="top" align="right">
										&nbsp;&nbsp;
										<html:select property="synonym" styleClass="black-smalltext" style="width:100px" >
										<%
											ArrayList allSynonyms = ((LoginData)session.getAttribute(IContactConstants.SESSION_LOGIN_OBJ)).getAllSynonyms();
											for (int index = 0; index < allSynonyms.size(); index++){%>
												<html:option  value='<%= (String) allSynonyms.get(index)%>' styleClass="black-smalltext" />
										<%}%>
										</html:select>
										&nbsp;&nbsp;
										<input type="image"
										src="<%=imagePath%>/button-configure.jpg" name="submit_btn"
											onclick="LoginForm.submit();" align="top" />
								</td>
								<td >&nbsp;</td>
								</html:form>
							</tr>
							<tr>
								<td >&nbsp;</td>			
								<td height="2px" colspan="2">&nbsp;</td>
								<td >&nbsp;</td>				
							</tr>
						</table>
						</td>
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					</tr>
					<tr height="10">
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						<td width="270" bgcolor="#999999"></td>
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					</tr>						
					
				</table>
				</td>
				<td width=25><img src="<%=imagePath%>/white-square.gif"></td>
				<td width=270 height="300" valign=top><img
					src="<%=imagePath%>/related-news.gif?<%=dt.getTime()%>" width="270" height="300" /><br>
				</td>
			</tr>
		</table>
		<form name="helpForm">
			<input name='imagePath' type='hidden' value='<%=imagePath%>' />
			<DIV id="help" class="helpbox"></DIV>
		</form>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td colspan=2></td>
	</tr>
</table>

</center>
</body>
</html>
